<?php
session_start(); 
include '../connect.php';
mysql_query ('SET NAMES \'UTF8\'');
?>

<!DOCTYPE html> 
<html> 
	<head> 
	<title>[Rec]ON - Tous les Articles</title> 
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" /> 
	<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />
	<link rel="stylesheet" href="themes/recontv-theme.css" />
	<link rel="stylesheet" href="stylesmobile.css" />
	<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
	<script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head> 
<body> 


<div data-role="dialog" id="erreur">

	<div data-role="header">
		<h1>Erreur 404</h1>
	</div><!-- /header -->

	<div data-role="content">	
        <p>La page n'a pas été créée/retrouvée</p>
	</div><!-- /content -->

</div><!-- /page -->

<div data-role="page" id="index">

	<div data-role="header">
		<a data-role="button" data-icon="search" data-iconpos="notext" data-inline="true" href="#erreur" data-transition="pop"></a>
		<h1>[Rec]ON - Tous les Articles</h1>
		<a data-role="button" data-icon="home" data-ajax="false" data-iconpos="notext" href="../index.php"></a>
	</div><!-- /header -->
	
	<div data-role="content">
	
		<div data-role="controlgroup" data-type="horizontal" style="margin:auto; width:239px;">
			<a data-role="button" data-icon="video" data-inline="true" data-ajax="false" data-iconpos="left" href="allvideos.php">Vidéos</a>
			<a data-role="button" data-icon="article" data-inline="true" data-ajax="false" data-iconpos="left" href="allarticles.php">Articles</a>
		</div>
	
        	<ul data-role="listview" data-inset="true" data-theme="d" data-divider-theme="d">
                <li data-role="list-divider">Culture Web</li>
                <?php
					// Requête SQL affichant les 4 dernières news
					$result = mysql_query('
					SELECT image, id_reportage, id_vimeo, titre 
					FROM reportage
					WHERE reportage.id_categorie =1
					AND id_type =2
					ORDER BY DATE DESC LIMIT 0 , 5
					');

					// Boucle pour afficher les resultats
					while($row = mysql_fetch_row($result)){
				?>
				<li>
                    <a href="article.php?id=<?php echo $row[1];  if ($row[2] != NULL) {echo '&id_vimeo='.$row[2].'';}?>&page=0&ajout=0" data-ajax="false">
                    	<img class="uneimg" src="../images/<?php echo $row[0]?>" /> <!-- Images -->
                    	<h3><u><?php echo $row[3]; ?></u></h3><!-- 1->Titre -->
                	</a>
                </li>
				<?php
					}
				?>
                
                <li data-role="list-divider">Nouvelles Technologies</li>
                <?php
					$result = mysql_query('
					SELECT image, id_reportage, id_vimeo, titre 
					FROM reportage
					WHERE reportage.id_categorie =6
					AND id_type =2
					ORDER BY DATE DESC LIMIT 0 , 5
					');

					// Boucle pour afficher les resultats
					while($row = mysql_fetch_row($result)){
				?>
				<li>
                    <a data-ajax="false" href="article.php?id=<?php echo $row[1];  if ($row[2] != NULL) {echo '&id_vimeo='.$row[2].'';}?>&page=0&ajout=0">
                    	<img class="uneimg" src="../images/<?php echo $row[0]?>" /> <!-- Images -->
                    	<h3><u><?php echo $row[3]; ?></u></h3><!-- 1->Titre -->
                	</a>
                </li>
				<?php
					}
				?>
				
				<li data-role="list-divider">Culture nippone</li>
                <?php
					// Requête SQL affichant les 4 dernières news
					$result = mysql_query('
					SELECT image, id_reportage, id_vimeo, titre 
					FROM reportage
					WHERE reportage.id_categorie =3
					AND id_type =2
					ORDER BY DATE DESC LIMIT 0 , 5
					');

					// Boucle pour afficher les resultats
					while($row = mysql_fetch_row($result)){
				?>
				<li>
                    <a data-ajax="false" href="article.php?id=<?php echo $row[1];  if ($row[2] != NULL) {echo '&id_vimeo='.$row[2].'';}?>&page=0&ajout=0">
                    	<img class="uneimg" src="../images/<?php echo $row[0]?>" /> <!-- Images -->
                    	<h3><u><?php echo $row[3]; ?></u></h3><!-- 1->Titre -->
                	</a>
                </li>
				<?php
					}
				?>
			</ul>
	</div><!-- /content -->

</div><!-- /index -->

</body>
</html>